class Solution(object):
    def checkPossibility(self, nums):
        """
        :type nums: List[int]
        :rtype: bool
        """
        if not nums or len(nums) <= 1:
            return True
        count = 0
        for i in range(1,len(nums)):
            if nums[i] < nums[i-1]:
                count+=1
                if count>1:
                    return False
                if i<2 or nums[i]>=nums[i-2]:
                    nums[i-1] = nums[i]
                else:
                    nums[i] = nums[i-1]
        return True






a = [4,2,3]
s= Solution()
m=s.checkPossibility(a)
print(m)